# 12/12
# 文件的创建
f = open('111','r',encoding='utf-8')
print(f.read())
# 用with open读取文件
with open('111','r',encoding='utf-8') as f:
    text = f.read()
print(text)

# 写文件write()
d = 'hello,world'
f1 = open('333.text','w',encoding='utf-8')
f1.write('sefefdsfwedwe')
f1.close()

f2 = open('333.text','a',encoding='utf-8')
f2.write(d)
f2.close()

# 用with open添加文件
with open('333.text','a',encoding='utf-8') as f:
    f.write(d)

